<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 1. 咒语和药水的成功对数
        // 暴力解法
        var successfulPairs = function(spells, potions, success) {
            let ans = new Array(spells.length).fill(0)
            for (let i = 0; i < spells.length; i++) {
                for (let j = 0; j < potions.length; j++) {
                    if (spells[i] * potions[j] >= success) {
                        ans[i]++
                    }
                }
            }
            return ans
        };
        console.log(maximumCount([-2,-1,-1,1,2,3]), 'maximumCount');
        // console.log(maximumCount([-3,-2,-1,0,0,1,2]), 'maximumCount');
        // console.log(maximumCount([5,20,66,1314]), 'maximumCount');
        
    </script>
</body>

</html>